package com.duanjc.doc.es.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.Date;

/**
 * [一句话描述该类的功能]
 *
 * @author : [duanjiangcheng]
 * @version : [v1.0]
 * @createTime : [2023/6/28 18:47]
 */
@Data
@Document(indexName = "wikipagecontent")
public class WikiPageEsContent implements Serializable {


    private static final long serialVersionUID = 7822727872215803538L;
    /**
     * 主键自增ID
     */
    @Id
    @Field(type = FieldType.Keyword)
    private String id;

    /**
     * 页面ID
     */
    @Field(type = FieldType.Long)
    private Long pageId;

    @Field(analyzer = "ik_max_word",type = FieldType.Text)
    private String name;

    /**
     * 内容
     */
    @Field(analyzer = "ik_max_word",type = FieldType.Text)
    private String content;

    /**
     * 创建人ID
     */
    @Field(type = FieldType.Long)
    private Long createUserId;

    /**
     * 创建人名字
     */
    @Field(type = FieldType.Text)
    private String createUserName;

    /**
     * 创建时间
     */
    @Field(type = FieldType.Date)
    private Date createTime;

    /**
     * 修改人ID
     */
    @Field(type = FieldType.Long)
    private Long updateUserId;

    /**
     * 修改人名字
     */
    @Field(type = FieldType.Text)
    private String updateUserName;

    /**
     * 修改时间
     */
    @Field(type = FieldType.Date)
    private Date updateTime;

    /**
     * 预览内容
     */
    @Field(analyzer = "ik_max_word",type = FieldType.Text)
    private String preview;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Long getPageId() {
        return pageId;
    }

    public void setPageId(Long pageId) {
        this.pageId = pageId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Long getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(Long createUserId) {
        this.createUserId = createUserId;
    }

    public String getCreateUserName() {
        return createUserName;
    }

    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Long getUpdateUserId() {
        return updateUserId;
    }

    public void setUpdateUserId(Long updateUserId) {
        this.updateUserId = updateUserId;
    }

    public String getUpdateUserName() {
        return updateUserName;
    }

    public void setUpdateUserName(String updateUserName) {
        this.updateUserName = updateUserName;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getPreview() {
        return preview;
    }

    public void setPreview(String preview) {
        this.preview = preview;
    }

    @Override
    public String toString() {
        return "WikiPageEsContent{" +
                "id='" + id + '\'' +
                ", pageId=" + pageId +
                ", name='" + name + '\'' +
                ", content='" + content + '\'' +
                ", createUserId=" + createUserId +
                ", createUserName='" + createUserName + '\'' +
                ", createTime=" + createTime +
                ", updateUserId=" + updateUserId +
                ", updateUserName='" + updateUserName + '\'' +
                ", updateTime=" + updateTime +
                ", preview='" + preview + '\'' +
                '}';
    }
}
